#include <cstdint>
#include <iostream>
#include <vector>

#include <bsoncxx/v_noabi/bsoncxx/builder/basic/document.hpp>
#include <bsoncxx/v_noabi/bsoncxx/json.hpp>
#include <mongocxx/v_noabi/mongocxx/client.hpp>
#include <mongocxx/v_noabi/mongocxx/instance.hpp>
#include <mongocxx/v_noabi/mongocxx/uri.hpp>

using bsoncxx::builder::basic::kvp;
using bsoncxx::builder::basic::make_document;

int main() {
  mongocxx::instance instance;
  mongocxx::uri uri("mongodb://127.0.0.1:27017/");
  mongocxx::client client(uri);
  auto db = client["quiz_app"];
  auto collection = db["users"];

  auto result = collection.find_one(make_document(kvp("username", "sds")));
  if (result) {
    std::cout << bsoncxx::to_json(*result) << std::endl;
  } else {
    std::cout << "No result found" << std::endl;
  }
}